//
//  YFStarCell.m
//  SquashSpark
//
//  Created by Coollang on 2017/11/3.
//  Copyright © 2017年 Coollang-YF. All rights reserved.
//

#import "YFStarCell.h"
#import "YFStarVideoModel.h"
#import <SDWebImage/UIImageView+WebCache.h>

@implementation YFStarCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (void)setStarVideoModel:(YFStarVideoModel *)starVideoModel {
    _starVideoModel = starVideoModel;
    if (starVideoModel.posterImageName) {
        [self.posterImageView sd_setImageWithURL:[NSURL URLWithString:starVideoModel.posterImageName] placeholderImage:kPlaceholdImage];
    }else{
        self.posterImageView.image = [UIImage imageNamed:@"video_coming_soon"];
    }
    self.posterTitleLabel.text = starVideoModel.starName;
    
    if (starVideoModel.videosCount <= 0) {
        self.videoCountLabel.text = @"";
    }else {
        self.videoCountLabel.text = [NSString stringWithFormat:@"%ld videos",(long)starVideoModel.videosCount];
    }
}

@end
